package org.uim.cricket.entities.fielding;

public enum FieldingTypes {
	
	CATCH,
	CATCH_WICKETKEEPER,
	CATCH_OWN_BOWLING,
	RUNOUT,
	STUMPED,
	OTHER,
	UNKNOWN;
	
	public FieldingTypes getFromStr(String type) {
		String src = type.toUpperCase().trim();
		if (src.equalsIgnoreCase("CATCH")) return FieldingTypes.CATCH;
		else if (src.equalsIgnoreCase("CATCH_WICKETKEEPER")) return FieldingTypes.CATCH_WICKETKEEPER;
		else if (src.equalsIgnoreCase("CATCH_OWN_BOWLING")) return FieldingTypes.CATCH_OWN_BOWLING;
		else if (src.equalsIgnoreCase("RUNOUT")) return FieldingTypes.RUNOUT;
		else if (src.equalsIgnoreCase("STUMPED")) return FieldingTypes.STUMPED;
		else if (src.equalsIgnoreCase("OTHER")) return FieldingTypes.OTHER;
		return FieldingTypes.UNKNOWN;
	}
}
